# -Configures for the use of @TARGET_NAME@ interface
# This file is configured by @TARGET_NAME@ for use by an external project
# This file is configured by @TARGET_NAME@ make system and SHOULD NOT BE EDITED
# 
# It defines the following variables
#    @TARGET_NAME@_INCLUDE_DIR directory where the include files are installed
#    @TARGET_NAME@_LIBRARIES library of the G4-MPI interface
#    @TARGET_NAME@_FOUND TRUE if package correctly setup
# Usage:
#   Add -D@TARGET_NAME@_DIR=.... to cmake command line when building 
#   a @TARGET_NAME@ enabled application
# 
# You may supply a version number through find_package which will be checked
# against the version of this build. Standard CMake logic is used so that
# the EXACT flag may be passed, and otherwise this build will report itself
# as compatible with the requested version if:
#
#  VERSION_OF_THIS_BUILD >= VERSION_REQUESTED
# You can specify additional components of Geant4 through the
# COMPONENTS argument to find_package.
# Specifiying additional components will enable a check on the existence of 
# these components, with the following per component variables being set:
#
#  @TARGET_NAME@_${COMPONENT}_FOUND    TRUE is the Geant4 library 
#                                      "component" was found
# Components
# ---------------------
#  static            (Static libraries available. Using this component
#                     when static libraries are available will result in
#                     @TARGET_NAME@_LIBRARIES being populated with the static
#                     versions of the Geant4 libraries. It does not
#                     guarantee the use of static third party libraries.)



find_package(MPI REQUIRED)

#Treatment of static libs
set(@TARGET_NAME@_static_FOUND @BUILD_STATIC_LIBS@)
set(@TARGET_NAME@_shared_FOUND @BUILD_SHARED_LIBS@)

if(@TARGET_NAME@_shared_FOUND)
   set(_libsuffix "")
else()
   set(_libsuffix "-static")
endif()

if(@TARGET_NAME@_FIND_REQUIRED_static AND @TARGET_NAME@_static_FOUND)
  set(_libsuffix "-static")
  list(REMOVE_ITEM @TARGET_NAME@_FIND_COMPONENTS static)
endif()



# Compute paths
get_filename_component(@TARGET_NAME@_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(@TARGET_NAME@_INCLUDE_DIR @CONF_INCLUDE_DIRS@ ${MPI_CXX_INCLUDE_PATH})

SET(G4MPI_OLD_MPI @G4MPI_OLD_MPI@)

if(G4MPI_OLD_MPI)
  add_definitions(-DTOOLS_USE_MPI_PACK_NOT_CONST)
  add_definitions(-DG4MPI_USE_MPI_PACK_NOT_CONST)
  # Prevent warning with c++11 on old MPI 
  add_definitions(-Wno-literal-suffix)
endif()

# Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET foo AND NOT @TARGET_NAME@_BINARY_DIR)
  include("${@TARGET_NAME@_CMAKE_DIR}/@TARGET_NAME@Targets.cmake")
endif()

#These are IMPORTED targets created by G4mpiTargets.cmake
SET(@TARGET_NAME@_LIBRARIES @TARGET_NAME@${_libsuffix} ${MPI_CXX_LIBRARIES})
link_directories(${MPI_CXX_LIBRARY_DIRS})

SET(G4mpi_FOUND TRUE)


 

 
